function V = ComputeF( a1,a2,a3,s1,s2,s3,b1,b2,b3,accx,accy,accz,g)

T=[1 a3 -a2;
     -a3 1 a1;
     a2 -a1 1;];

 K=[s1 0 0;
       0 s2 0;
       0 0 s3;];

 B=[b1;b2;b3;];

 ACC=[accx;accy;accz;];
 
 F=K*(ACC+B);
 
 F=T*F;
 
V=(sqrt(F'*F)-g)*(sqrt(F'*F)-g);

end

